package edu.wt.domain;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

import edu.wt.domain.User;
import edu.wt.dbutil.ResultSetHandler;

public class UserList implements ResultSetHandler<List<User>>{

	@Override
	public List<User> hander(ResultSet rs) {
		List<User> list0=new ArrayList<>();
		try {
			while(rs.next()) {
				User user=new User(rs.getInt(1),rs.getString(2),rs.getString(3),rs.getString(4),LocalDateTime.now());
				list0.add(user);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return list0;
	}

}
